package zhh.tangbao.commodity.serivce;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import zhh.tangbao.commodity.dto.MachineQueryDto;
import zhh.tangbao.commodity.dto.MachineStockQueryDto;
import zhh.tangbao.commodity.entity.CommodityMachineEntity;
import zhh.tangbao.commodity.entity.CommodityMachineStock;
import zhh.tangbao.commodity.vo.CommodityMachineStockVo;
import zhh.tangbao.commodity.vo.MachineOptionsVo;
import zhh.tangbao.commodity.vo.StockDataVo;
import zhh.tangbao.commodity.vo.StockVo;

import java.util.List;

/**
 * <p>
 *     机器管理业务
 * </p>
 * @author 粥灰灰
 * <p>2023/3/2</p>
 */
public interface CommodityMachineService {
    int add(CommodityMachineEntity commodityMachineEntity);

    int delete(String id);

    int update(CommodityMachineEntity commodityMachineEntity);

    CommodityMachineEntity get(String id);

    Page<CommodityMachineEntity> page(MachineQueryDto dto);

    int addStock(CommodityMachineStock commodityMachineStock);

    int deleteStock(Integer stockId);

    int updateStock(CommodityMachineStock commodityMachineStock);

    CommodityMachineStock getStock(Integer stockId);

    /**
     * 获取机器内的所有库存信息
     *
     * @param dto
     * @return
     */
    List<CommodityMachineStockVo> getAllMachineStocks(MachineStockQueryDto dto);

    Page<StockVo> machineStockPage(MachineQueryDto dto);


    int deleteStocks(List<Integer> ids);

    int batchAddStock(List<CommodityMachineStock> stocks);

    int batchDelete(List<String> ids);

    List<StockDataVo> getStockDataVo(String machineId);

    Page<CommodityMachineEntity> statePage(MachineQueryDto dto);

    List<MachineOptionsVo> machineToOptions();

}
